package com.ibeeking.gmc.global.g.rest.controller.v1;

import com.ibeeking.found.common.enums.NoRuleEnum;
import com.ibeeking.gmc.global.service.common.vo.NoBaseRuleVO;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName CommonController
 * @Description 公共控制器
 * @Author ibeeking
 **/
@RestController
@RequestMapping("/g/common/v1")
public class CommonController {

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询号码基础规则列表")
    @GetMapping(value = "/noRuleList")
    public List<NoBaseRuleVO> baseCardNoRuleList() {
        return Arrays.stream(NoRuleEnum.values()).map(x -> new NoBaseRuleVO().setCode(x.getCode()).setName(x.getName()).setRemarks(x.getRemarks())).collect(Collectors.toList());
    }


}
